<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('可转债数据列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>债券代码：</label>
                            <input type="text" name="bondId"/>
                        </li>
                        <li>
                            <label>债券名称：</label>
                            <input type="text" name="bondNm"/>
                        </li>
                        <li>
                            <label>正股代码：</label>
                            <input type="text" name="stockId"/>
                        </li>

                        <li>
                            <label>评级：</label>
                            <input type="text" name="ratingCd"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:data:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:data:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:data:remove')}]];
    var prefix = ctx + "system/data";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "可转债数据",
            columns: [{
                checkbox: true
            },
                {
                    field: 'bondId',
                    title: '债券代码'
                },
                {
                    field: 'bondNm',
                    title: '债券名称',
                    width: '100px' // 设置列宽为200像素
                },

                {
                    field: 'price',
                    title: '债券价格'
                },
                {
                    field: 'convertPrice',
                    title: '转股价格'
                },
                {
                    field: 'convertValue',
                    title: '转股价值'
                },
                {
                    field: 'increaseRt',
                    title: '债券涨跌幅'
                },

                {
                    field: 'stockNm',
                    title: '正股名称'
                },


                {
                    field: 'premiumRt',
                    title: '转股溢价率'
                },

                {
                    field: 'bondValue',
                    title: '纯债价值'
                },
                {
                    field: 'ratingCd',
                    title: '评级'
                },


                {
                    field: 'yearLeft',
                    title: '剩余年限'
                },
                {
                    field: 'ytmRt',
                    title: '到期收益率'
                },
                {
                    field: 'putYtmRt',
                    title: '回售收益率'
                },
                {
                    field: 'redeemDt',
                    title: '赎回日期'
                },
                {
                    field: 'lastTime',
                    title: '最后更新时间'
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.bondId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
